﻿using Infra.Common.Interfaces;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Infra.Common.Image
{
    public class ImageController
    {
        public const string K_BACKGROUND = "bkg.jpg";
        public const string K_LOGO_CLIENT = "logo.jpg";
        public const string K_LOGO_SOFTPOWER_H = "SoftPower_logo_H.jpg";
        public const string K_LOGO_SOFTPOWER_V = "SoftPower_logo_V.jpg";

        public void ApplyImage(IBaseSettings settings, PictureBox pic, string strResourceName)
        {

            string pathImage = Path.Combine(settings.ConfigurationPath + @"\templates\media", strResourceName);

            if (File.Exists(pathImage))
            {
                if (pic.Image != null) pic.Image.Dispose();

                pic.Load(pathImage);

            }
        }
    }
}
